package Template;
/**
 * @author jun
 * @description 模版方法
 */
public abstract class Template {
    public abstract void run();

    public final void test(){
        double start = System.currentTimeMillis();
        this.run();
        double end = System.currentTimeMillis();
        System.out.println(end-start);
    }
}

class Explicit extends Template{
    public static void main(String[] args){
        Template e = new Explicit();
        e.test();
    }
    @Override
    public void run() {
        int j = 0;
        for(int i = 0; i < 1000000; i++){
            j++;
        }
    }
}
